// import axios from 'axios'
import request from '@/utils/request'
import API from './constants'

/**
 * 获取所有分类数据
 * @returns 分类
 */
export const getCategories = () => request({
  url: API.TABS_API
})

/**
 * 查询子分类
 * @param {*} id 父级分类 id
 * @returns 子分类数组
 */
export const getSubCategories = id => request({
  url: API.TAB_API + '/' + id
})

// 获取轮播图数据
// export const getBanners = () => axios({
//   url: API.BANNERS_API
// })

export const getBanners = () => request({
  url: API.BANNERS_API_TAB,
  headers: {
    'x-platform': 'pc'
  }
})

// 获取爆款商品
export const getBaoKuanItems = (start = 0) => request({
  url: API.BAOKUAN_API,
  params: {
    start
  }
})
